package cn.siat.system.api.factory;

import cn.siat.common.core.domain.R;
import cn.siat.system.api.RemoteAlgorithmService;
import cn.siat.system.api.RemoteFileService;
import cn.siat.system.api.RemoteUserService;
import cn.siat.system.api.domain.SysFile;
import cn.siat.system.api.domain.SysUser;
import cn.siat.system.api.model.LoginUser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * 用户服务降级处理
 * 
 * @author siat
 */
@Component
public class RemoteAlgorithmFallbackFactory implements FallbackFactory<RemoteAlgorithmService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteAlgorithmFallbackFactory.class);

    @Override
    public RemoteAlgorithmService create(Throwable throwable)
    {
        log.error("python服务调用失败:{}", throwable.getMessage());
        return new RemoteAlgorithmService()
        {
            @Override
            public Map<String, Object> analysis(Map<String, Object> param, String source) {
                return null;
            }

            @Override
            public Map<String,Object>  optimization(Map<String, Object> param, String source) {
                return null;
            }

            @Override
            public Map<String, Object> ggo(Map<String, Object> param, String source) {
                return null;
            }
        };
    }
}
